import request from "@/utils/request";

enum API {
    ALLPERMISSTION_URL = '/admin/acl/permission',
    ADDMENU_URL = '/admin/acl/permission/save',
    UPDATE_URL = '/admin/acl/permission/update',
    DELETEMENU_URL = '/admin/acl/permission/remove/'
}

// 获取菜单数据
export const reqAllPermisstion = () => request.get<any, any>(API.ALLPERMISSTION_URL)

// 添加与更新菜单的方法
export const reqAddOrUpdateMenu = (data: any) => {
    if (data.id) {
        return request.put<any, any>(API.UPDATE_URL, data)
    } else {
        return request.post<any, any>(API.ADDMENU_URL, data)
    }
}

// 删除某一个已有的菜单
export const reqRemoveMenu = (id: any) => request.delete<any, any>(API.DELETEMENU_URL + id)






















































